<template>
  <div class="section-container login-container un-select">
    <div class="body fix-width">
      <div class="top">
        <!-- <logo class="logos" /> -->
        <div class="top-title">
          账号密码登录
        </div>
      </div>
      <div class="main">
        <login-pwd />
        <!-- <div class="foot-link clearFix" />
        <div v-if="isShowWX" class="foot-link">
          <el-divider content-position="center">
            其他方式登录
          </el-divider>
          <we-chat-login />
        </div> -->
      </div>
    </div>
  </div>
</template>

<script setup name="Login">
import { ref, onBeforeMount, onMounted, onUnmounted } from 'vue'
import { isMobile } from '@/utils/device'
import { debounce } from 'lodash-unified'

import Logo from './components/logo.vue'
import WeChatLogin from './components/weChatLogin'
import LoginPwd from './loginPwd.vue'

const isShowWX = ref(true)

const resizeCb = debounce(() => {
  isShowWX.value = !isMobile()
}, 50)

onBeforeMount(() => {
  isShowWX.value = !isMobile()
})

onMounted(() => {
  window.addEventListener('resize', resizeCb)
})

onUnmounted(() => {
  window.removeEventListener('resize', resizeCb)
})
</script>

<style lang="scss" scoped>
.login-container {
  width: 100%;
  min-height: 100vh;
  padding: 15vh 0 100px;
  position: relative;
  // background: #fff;
  // background-color: #0f172a /* #0f172a */;
  // background: radial-gradient(circle at center, #081b47, #0f172a, #061944);
  background: linear-gradient(45deg, #12203f, #102249, #081c4d, #031849);
}
.body {
  padding: 30px 40px;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  border: 1px solid #040e22;
  background-color: rgba(100, 99, 99, 0.212);
  vertical-align: middle;
  min-width: 260px;
  width: 380px;
  margin: 5rem auto;
}

.logos {
  margin: 0 auto 20px;
}

.top-title {
  // color: rgba(16, 16, 16, 1);
  color: rgba(255, 255, 255, 1);
  font-size: 20px;
  height: 29px;
  line-height: 29px;
  text-align: center;
}
.main {
  margin-top: 20px;
  .foot-link {
    text-align: center;
    margin-top: 1px;
    .link-item {
      margin: 0;
      font-size: 12px;
      line-height: 18px;
      color: #1890ff;
    }
  }
}

.foot-link {
  .el-button {
    font-size: 12px;
  }
}

// 适配移动端
@media screen and (max-width: 768px) {
  .body {
    padding: 0 30px;
    box-shadow: none;
    border: 0;
    background: transparent;
    border-radius: 0;
  }
  .w380 {
    margin: 0 auto;
    width: 100vw;
    min-width: 100vw;
  }
}
</style>
